<!--  -->
<template>
    <div class=''>
       
        <el-button type="text" style="position: absolute; top: 0;left: 15px;color: black;font-size: 18px;" @click="ESC()">返回</el-button>
        <el-form ref="form" :model="form" label-width="85px">
            <el-form-item label="垛位号" style="width: 205px;">
                <el-input v-model="form.dwNum"></el-input>
            </el-form-item>
            <el-form-item label="件次号" style="width: 205px;">
                <el-input v-model="form.jcNum"></el-input>
            </el-form-item>
            <el-form-item label="批次" style="width: 200px;">
                <el-input v-model="form.pc"></el-input>
            </el-form-item>
            <el-form-item label="重量" style="width: 200px;">
                <el-input v-model="form.zl"></el-input>
            </el-form-item>
            <el-form-item label="规格" style="width: 200px;">
                <el-input v-model="form.gg"></el-input>
            </el-form-item>
            <el-form-item label="审批总件数" style="width: 200px;">
                <el-input v-model="form.sp"></el-input>
            </el-form-item>
            <el-form-item label="入库件数" style="width: 200px;">
                <el-input v-model="form.rk"></el-input>
            </el-form-item>
        </el-form>
        <el-button plain style="position: absolute;right: 0" @click="Warehousing()">入库</el-button>
    </div>
</template>

<script>
import $ from 'jquery';
import 'jquery.soap';
export default {
    name: 'PageNine',
    //import引入的组件需要注入到对象中才能使用
    components: {},
    data() {
        //这里存放数据
        return {
            form: {
                dwNum: '',
                jcNum: '',
                pc: '',
                zl: '',
                gg: '',
                sp: '',
                rk: ''
            },
        };
    },
    //监听属性 类似于data概念
    computed: {},
    //监控data中的数据变化
    watch: {},
    //方法集合
    methods: {
        ESC() {
            window.history.go(-1);
        },
        Warehousing() {
            var val = this.$route.query.val;
            var val2 = this.$route.query.val2;
            var val3 = sessionStorage.getItem('LoginUser').split(',')[1];
            $.soap({
                url: 'api/pdaservices/services/location?',
                method: 'RecMaterial',
                data: {
                    in0: val2,
                    in1: val3,
                    in2: '1',
                    in3: val
                },
                success: function (res) {
                    var text = res.content.all;
                    for (var i = 0; i < text.length; i++) {
                        if (text[i].nodeName == "xsd:anyType") {
                               alert(text[text.length-1].innerHTML);
                               break;
                        }
                    }
                }
            })
        }
    },
    //生命周期 - 创建完成（可以访问当前this实例）
    created() {

    },
    //生命周期 - 挂载完成（可以访问DOM元素）
    mounted() {
        var val = this.$route.query.val;
        var val2 = this.$route.query.val2
        this.form.dwNum = val2;
        this.form.jcNum = val;
        var that = this;
        $.soap({
            url: 'api/pdaservices/services/location?',
            method: 'CompleteDetail',
            data: {
                in0: '24320612615',
                in1: sessionStorage.getItem('LoginUser').split(',')[1]
            },
            success: function (res) {
                var val = res.content.all;
                var arr = [];
                for (var i = 0; i < val.length; i++) {
                    if (val[i].nodeName == "xsd:anyType") {
                        arr.push(val[i].innerHTML)
                    }
                }
                that.form.pc = arr[1];
                that.form.zl = arr[2];
                that.form.gg = arr[3];
                that.form.sp = arr[4];
                that.form.rk = arr[5];
            }
        })
    },

}
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类</style>